package com.journey.org.ui.knowledge.gankio.list

import android.os.Bundle
import android.view.LayoutInflater
import android.view.ViewGroup
import com.journey.org.BR
import com.journey.org.R
import com.journey.org.databinding.FragmentGankListBinding
import com.mvvmhabit.org.base.BaseLazyFragment

/**
 * @Date: 2020/12/17 11:39
 * @Author:小妖
 * @Description: 干货列表
 */
class GankListFragment : BaseLazyFragment<FragmentGankListBinding, GankListViewModel>() {

    private lateinit var type: String

    override fun initParam() {
        super.initParam()
        type = arguments?.getString("type")!!
    }

    override fun initVariableId(): Int = BR.viewModel

    override fun initViewModel(): Class<GankListViewModel> = GankListViewModel::class.java

    override fun initContentView(
        inflater: LayoutInflater?,
        container: ViewGroup?,
        savedInstanceState: Bundle?
    ): Int = R.layout.fragment_gank_list

    override fun lazyLoadData() {
        if (type.isNotEmpty()) {
            mViewModel?.loadGankList(type)
        }
    }

}